<template>
  <cml-module-item :title="titleText">
    <a-switch size="small"
      :loading='loading'
      :checked="isOpen"
      @change="toggleConnect" />
  </cml-module-item>
</template>
<script>
import { Switch } from 'ant-design-vue'
import CmlModuleItem from '../cml-module-item'
export default {
  name: 'Remote',
  components: {
    ASwitch: Switch,
    CmlModuleItem
  },
  model: {},
  props: {
    isOpen: {
      type: Boolean,
      default: false
    },
    loading: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {}
  },
  watch: {
    /* isOpen(v) {
      if (v) {
        app.msg({ type: 'info', content: '远程控制已开启' })
      } else {
        app.msg({ type: 'info', content: '远程控制已关闭' })
      }
    } */
  },
  computed: {
    titleText() {
      return this.$t('cmlpanel.remote')
    },
  },
  created() {},
  mounted() {},
  beforeDestroy() {},
  methods: {
    toggleConnect(value) {
      this.$emit('change', value)
    }
  }
}
</script>
<style lang="scss" scoped></style>
